//
// Created by Huafv on 2024/10/11.
//

#include <pthread.h>
#include <unistd.h>
#include "bt_phybusif_h4.h"
#include "bt_wrapper.h"
#include "ringbuffer.h"
#include "bt_config.h"
#include "bt_snoop.h"

/******************************* Defines ***********************/


/**
 * @brief bluetooth start
 * @param app_cb
 * @return
 */
uint8_t bt_start(bt_app_cb_t *app_cb)
{
    phybusif_open(BT_BAUDRATE_1);
#if BT_ENABLE_SNOOP > 0
    bt_snoop_init();
#endif
    for(int i = 0; i < 10; i++){
        uint8_t hci_reset[4] = {0x01, 0x03, 0x0c, 0x00};
        uart_bt_send(hci_reset, 4);
        sleep(1);
    }
    return 0;
}